The Transmission Control Protocol (TCP) is a connection-oriented, reliable, and byte-stream-based transport layer communication protocol. A TCP layer is an intermediate layer located above an Internet Protocol (IP) layer and below an application layer, and the TCP layer provides reliable pipe-like connections between application layers of different hosts. The application layer sends, to the TCP layer, a data stream for inter-network transmission. The TCP layer then divides the data stream into packet segments with proper lengths. Subsequently, the TCP layer transmits the packet segments to the IP layer, and the packet segments are transmitted to a TCP layer of a receive end entity using a network.
The TCP is a sliding window protocol. That is, how much data that can be sent at a moment by a transmit end connected by the TCP is controlled by a sliding window (transmit window). Size of the sliding window may be jointly determined by a receive window (Rwnd) and a congestion window (Cwnd). A smaller value between sizes of the Rwnd and the Cwnd is taken as the size of the sliding window. The Rwnd indicates a remaining space in a TCP protocol buffer at a receive end. A transmit end needs to ensure that data sent by the transmit end does not exceed the remaining space, so as to prevent a buffer overflow. This window is used by the receive end to limit a flow. The Cwnd is a window used by the transmit end to control a flow.
A TCP device transmits data in various networks. Because the TCP device does not know data transmission features of a network in which the TCP device runs, the TCP device needs to keep increasing or decreasing the size of the sliding window to adapt to changes of network status, and detect the network status. To control a network flow, the TCP uses four control mechanisms: slow start, congestion avoidance, fast retransmit, and fast recovery.
After a TCP connection is established, if network capabilities are unknown, a TCP transmit end first tentatively sends one packet. Size of the Cwnd is one packet. After receiving an acknowledgment (ACK), the TCP transmit end sends two more packets. After ACKs of the two packets are received, the Cwnd size increases to four packets. In this way, each time an ACK of one packet is received, the Cwnd size increases by one packet.
In a conventional network, because routing paths and network statuses between two communication nodes change constantly, algorithms in the TCP protocol, which are used by a single node to detect network status, evolve constantly. Due to inflexibility of a network, bandwidths are not fully utilized; and because of contentions between TCP transmission nodes, throughputs are all at low levels.
In some distributed computing applications, data needs to be efficiently transmitted between two computing nodes within a certain amount of time. Therefore, TCP-based optimization becomes increasingly important. Software-defined networking (SDN) provides application-based management and control capabilities, such that SDN-based TCP optimization becomes increasingly important.